package com.test.springbootweb.Controller;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SimpleController {
@RequestMapping("/simple")
//    public String Simplecontroller(HttpServletRequest request) {
//        String ager=request.getParameter("age");
//        String name=request.getParameter("name");
//        int age = Integer.parseInt(ager);
//        System.out.println(name+","+age);
//        return "ok";
//    }
//    public String Simplecontroller(String name,Integer age) {
//        System.out.println(name+","+age);
//        return "ok";
//    }
public String Simplecontroller(@RequestParam(value = "name") String username, Integer age) {
    System.out.println(username+","+age);
    return "ok";
}
}
